package com.ccs.testcase;

import org.junit.BeforeClass;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;
import org.openqa.selenium.WebDriver;

import com.ccs.functions.Login;
import com.ccs.functions.Logout;
import com.ccs.functions.Webdriver;
import com.ccs.transmittal.Admin_Create_Transmittal_List;
import com.ccs.transmittal.Admin_Transmittal_List;
import com.ccs.transmittal.Misc_Transmittal;


@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class Transmittal_ReportInclude {

	private static WebDriver driver;
	public static String transmittal_hmo = "CALVO'S SELECTCARE";
	public static String window_handle;
	public static String transmittal_number;
	
	static
	Webdriver d = new Webdriver();
	Login in = new Login();
	Logout out = new Logout();
	Misc_Transmittal m = new Misc_Transmittal();
	Admin_Create_Transmittal_List actl = new Admin_Create_Transmittal_List();
	Admin_Transmittal_List atl = new Admin_Transmittal_List();
	
	@BeforeClass
	public static void startBrowser()throws Exception{
		driver = d.startUp();
	}
	@Test
	public void a_login_adminapp() throws Exception{
		System.out.println("Start Test: Login Admin Console");
		m.maximize_window(driver);
		in.admin(driver);
		System.out.println("End Test: Login Admin Console\n");
	}
	@Test
	public void b_display_transmittal_list_admin() throws Exception{
		System.out.println("Start Test: Goto Transmittal List");
		m.go_to_transmittal_admin(driver);
		System.out.println("End Test: Goto Transmittal List\n");
	}
	@Test
	public void c_generate_not_transmitted_report() throws Exception{
		System.out.println("Start Test: Generate Not Transmitted Report");
		window_handle = driver.getWindowHandle();
		m.generate_report_not_transmitted(driver, transmittal_hmo);
		System.out.println("End Test: Generate Not Transmitted Report\n");
	}
	@Test
	public void d_logout_adminapp() throws Exception{
		System.out.println("Start Test: Logout Admin Console");
		driver.switchTo().window(window_handle);
		out.admin(driver);
		System.out.println("End Test: Logout Admin Console\n");
	}
	@Test
	public void e_login_adminapp() throws Exception{
		System.out.println("Start Test: Login Admin Console");
		in.admin(driver);
		System.out.println("End Test: Login Admin Console\n");
	}
	@Test
	public void f_display_transmittal_list_admin() throws Exception{
		System.out.println("Start Test: Goto Transmittal List");
		m.go_to_transmittal_admin(driver);
		m.go_to_create_transmittal(driver);
		System.out.println("End Test: Goto Transmittal List\n");
	}
	@Test
	public void g_search_transmittal_manual() throws Exception{
		System.out.println("Start Test: Search for SOA/CI Discharged Yesterday");
		String my_date = atl.date();
		transmittal_number = actl.search_and_generate_soa_ci(driver, "COCOLIFE HEALTH CARE", my_date);
		System.out.println("End Test: Search for SOA/CI Discharged Yesterday\n");
	}
	@Test
	public void h_verify_transmittal_within_the_day() throws Exception{
		System.out.println("Start Test: Create Transmittal on Current Day");
		actl.verify_transmittal_within_the_day(driver);
		System.out.println("End Test: Create Transmittal on Current Day\n");
	}
	@Test
	public void i_logout_adminapp() throws Exception{
		System.out.println("Start Test: Logout Admin Console");
		out.admin(driver);
		System.out.println("End Test: Logout Admin Console\n");
		driver.close();
	}
}
